<?php echo $this->Html->script('JqueryTimesheet'); ?>
<div class="timesheets index">
	<h2><?php echo __('Timesheets'); ?></h2>
	<table cellpadding="0" cellspacing="0" id="timesheet" class="search">
	<thead>
	<tr>

			<th><?php echo $this->Paginator->sort('Username'); ?></th>
			<th><?php echo $this->Paginator->sort('date'); ?></th>
			<th><?php echo $this->Paginator->sort('start_time'); ?></th>
			<th><?php echo $this->Paginator->sort('end_time'); ?></th>
			<th><?php echo $this->Paginator->sort('total_no._of_Hours'); ?></th>
			<th></th>
	</tr>
	</thead>
         	<tbody>
         	<?php
                         if (!empty($timesheets)){
                             foreach ($timesheets as $timesheet):
                         ?>
	<tr>
		<td>
			<?php echo $this->Html->link($timesheet['User']['username'], array('controller' => 'users', 'action' => 'view', $timesheet['User']['id'])); ?>
		</td>
		<td><?php echo $this->Html->link($timesheet['Timesheet']['date'], array('controller' => 'timesheets', 'action' => 'view', $timesheet['Timesheet']['id'])); ?></td>
		<td><?php echo h($timesheet['Timesheet']['start_time']); ?>&nbsp;</td>
		<td><?php echo h($timesheet['Timesheet']['end_time']); ?>&nbsp;</td>
		<td><?php echo h($timesheet['Timesheet']['total_no_hrs']); ?>&nbsp;</td>
	</tr>
    <?php
                                endforeach;
                            }else{
                            ?>
                            <tr>
                                <td>No Data Found</td>
                            </tr>
                            <?php }?>
	</tbody>
    </table>

	<p>

                	<div class="addbuttons" >
					<ul>
						<li><?php echo $this->Html->link(__('New Timesheet'), array('controller' => 'timesheets', 'action' => 'add')); ?> </li>
					</ul>
					</div>
        	<p>

	<p>
</div>
